<%-- 
    Document   : accueil
    Created on : 11 janv. 2015, 17:39:13
    Author     : Baptiste
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%> 
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><s:text name="accueil.detailAdresse"/></title>
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <link href="css/styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <header>
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="accueil"><s:text name="accueil.titleNavBar"/></a>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                    <s:text name='menu.adresses'/> <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="listAddress"><s:text name="menu.listeAdresses"/></a></li>
                                    <li><a href="<s:url action="ajout_ip"/>"><s:text name='menu.ajoutAdresse'/></a></li>
                                </ul>
                            </li>
                            
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                    <s:text name='menu.utilisateurs'/> <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <s:if test="%{#session.droit == 'admin'}">
                                        <li><a href="listUsers"><s:text name="menu.listeUtilisateurs"/></a></li>
                                    </s:if>
                                    <li><a href="<s:url action="inscription"/>"><s:text name='menu.ajoutUser'/></a></li>
                                </ul>
                            </li>  
                            <li><a href="apropos"><s:text name="menu.aPropos"/></a></li>
                        </ul>                  
                        <ul class="nav navbar-nav navbar-right">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><s:text name="accueil.profil"/><strong><s:property value="%{#session.user.identifiant}"/></strong><span class="caret"></span></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <s:url id="profil" action="profil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{profil}"><s:text name="accueil.myprofil"/></s:a>
                                    </li>
                                    <li>
                                        <s:url id="editProfil" action="editProfil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{editProfil}"><s:text name="accueil.modifierProfil"/></s:a>
                                    </li>          
                                    <li class="divider"></li>
                                    <li><a href="logout"><s:text name="accueil.deconnexion"/></a></li>
                                </ul>
                            </li>
                        </ul>                       
                    </div><!-- /.navbar-collapse -->               
                </div><!-- /.container-fluid -->
            </nav>
        </header>
        <section>
            <article>
                <div class="page-header">
                    <h1><s:text name="accueil.detailAdresse"/></h1>                   
                </div>
                
                <div class="panel panel-default">
                    
                    <div class="panel-body">
                        
                        <div style="text-align: right;">
                            <s:url id="checkHisto" action="voir_histo">
                                <s:param name="id_address" value="%{id_address}"></s:param>                
                            </s:url>
                            <s:a href="%{checkHisto}" cssClass="btn btn-primary">
                                <s:text name='adresse.voirhisto'/>
                            </s:a>                
                        </div>
                        <s:iterator value="historicSystem">
                            <div class="row">
                                <div class="col-md-4"><span style="font-weight: bold;"><s:text name="list.cpu"/></span></div>
                                <div class="col-md-4"><s:property value="cpuUse" /></div>
                            </div>
                            <div class="row">
                                <div class="col-md-4"><span style="font-weight: bold;"><s:text name="list.ramFree"/></span></div>
                                <div class="col-md-4"><s:property value="memFree" /></div>
                            </div>   
                        </s:iterator>  
                        <br>
                        <%--
                        <a id="checkHisto" class="btn btn-primary" href="<s:url action="voir_histo">"
                                  <s:param name="id_address" value="%{id_address}"></s:param> 
                              </s:url>
                              <s:text name='adresse.voirhisto'/></a>
                        
                        
                        <a id="checkHisto" class="btn btn-primary" href="<s:url action="voir_histo"/>"><s:text name='adresse.voirhisto'/></a> 
                        --%>
                        
                        <table class="table">
                            <thead>
                                <tr>
                                    <th><s:text name="listip.processus"/></th>
                                    <th><s:text name="listip.pid"/></th>
                                    <th><s:text name="listip.user"/></th>
                                    <th><s:text name="listip.cpu"/></th>
                                    <th><s:text name="listip.ram"/></th>
                                </tr>
                            </thead>
                            <tbody>
                                <s:iterator value="listProcess">
                                    <tr>
                                            <td><s:property value="command" /></td>
                                            <td><s:property value="pid_process" /></td>
                                            <td><s:property value="user_process" /></td>
                                            <td><s:property value="ram_use_process" /></td>
                                            <td><s:property value="cpu_use_process" /></td>
                                    </tr>                                   
                                </s:iterator>     
                            </tbody>
                        </table>

                    </div>
                    <div class="panel-footer">
                        <!--<nav>
                            <ul class="pagination">
                                <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
                                <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                                <li ><a href="#">2 <span class="sr-only">(current)</span></a></li>
                            </ul>
                        </nav>-->
                    </div>
                </div>
            </article>
        </section>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
    </body>
</html>